#ifndef ENTITY_H
#define ENTITY_H

#include "AbstractEntity.h"
#include "Texture.h"
#include "Color.h"
#include "Shape.h"
#include "Transformation.h"
#include "Cube.h"

class Entity : public AbstractEntity
{
protected:
	Texture m_texture;
	Color m_color;
	Shape* m_shape;

	std::vector<Position> m_points;

private:
	virtual void calcBoundingSize();

public:
	Entity();
	Entity( const Position& pos );

	virtual void preFrame( float frametime, const std::vector<Matrix4>& matrixes );

	void setShape( Shape* s ) { m_shape = s; }
	Shape* getShape() { return m_shape; }

	Texture& getTexture() { return m_texture; }
	void setTexture( const Texture& t ) { m_texture = t;}

	const Color& getColor() { return m_color; }
	void setColor( const Color& c ) { m_color = c; }

	const std::vector<Position>& getPoints() { return m_points; }

	void postFrame();

	void accept( AbstractVisitor* v );

	virtual bool hasCollision( AbstractEntity* other, bool doublechecked = true );
	virtual void checkCollision( AbstractEntity* other );
	void berekenMaxMin( Entity* c, Vector D, float& min, float& max );
};

#endif // ENTITY_H